package com.fxp.project.jiuselu.web.models.goods.mapper;

import com.fxp.project.jiuselu.web.models.goods.entity.JslActivity;
import com.fxp.project.jiuselu.web.models.goods.entity.JslGoodsAttr;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fxp.project.jiuselu.web.models.goods.vo.GoodsAttrVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 商品规格表 Mapper 接口
 * </p>
 *
 * @author Jason.Wang
 * @since 2021-11-01
 */
public interface JslGoodsAttrMapper extends BaseMapper<JslGoodsAttr> {

    /**
     * selectGoodsAttrVoListByGoodsId: 获取商品的规矩列表信息<br/>
     *
     * @param goodsId
     * @return
     * @author Jason.Wang
     * @date 2021/11/7 10:17 上午
     */
    List<GoodsAttrVo> selectGoodsAttrVoListByGoodsId(@Param("goodsId") Long goodsId);

    /**
     * selectGoodsAttrVoByGoodsAttrId: 查询当前商品的规格信息<br/>
     *
     * @param attrId
     * @return
     * @author Kai.Wang
     * @date 2021/11/22 10:43
     */
    GoodsAttrVo selectGoodsAttrVoByGoodsAttrId(@Param("attrId") Long attrId);

    List<JslActivity> selectGoodsActivityByGoodsIdAndAttrId(@Param("goodsId") Long goodsId);

    int updateStoreCountByGoodsIdAndAttrId(@Param("storeCount") Integer storeCount,@Param("goodsId") Long goodsId,@Param("attrId") Long attrId);
}
